Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding log to print all configuration flags at start of gcs fuse mount #1565

Merged
merged 14 commits into from
Dec 29, 2023

Conversation

ankitaluthra1
Copy link
Collaborator

@ankitaluthra1 ankitaluthra1 commented Dec 27, 2023

Description

Uses flagStorage struct to get all flags which are being used in gcsfuse and add a info log while starting gcsfuse

Link to the issue in case of a bug fix.

issue-link

Testing details

  1. Manual - Done on Local
  2. Unit tests - Added unit test for logic of aggregated log message containing all flags
  3. Integration tests - NA

@raj-prince
Copy link
Collaborator

raj-prince commented Dec 27, 2023

  1. In this PR, we are only logging passed flags, right? We also need to print the config flags.
  2. Could you please update the PR description with the newly added logs?
  3. Lint is failing.

@ankitaluthra1
Copy link
Collaborator Author

ankitaluthra1 commented Dec 27, 2023

text format log is attached
Screenshot 2023-12-28 at 10 11 53

Sample log in json format is as follows (For now I have kept "" in the log as I am not sure removing " from logs will result in any formatting errors for any customers, let me know if we need to remove "" from log statement)
{"time":{"timestampSeconds":1703683455,"timestampNanos":1703683455611934894},"severity":"INFO","msg":"Loading config for mount flags {\"AppName\":\"\",\"Foreground\":true,\"ConfigFile\":\"\",\"MountOptions\":{},\"DirMode\":493,\"FileMode\":420,\"Uid\":-1,\"Gid\":-1,\"ImplicitDirs\":false,\"OnlyDir\":\"\",\"RenameDirLimit\":0,\"CustomEndpoint\":null,\"BillingProject\":\"\",\"KeyFile\":\"\",\"TokenUrl\":\"\",\"ReuseTokenFromUrl\":true,\"EgressBandwidthLimitBytesPerSecond\":-1,\"OpRateLimitHz\":-1,\"SequentialReadSizeMb\":200,\"MaxRetrySleep\":30000000000,\"StatCacheCapacity\":4096,\"StatCacheTTL\":60000000000,\"TypeCacheTTL\":60000000000,\"HttpClientTimeout\":0,\"MaxRetryDuration\":-1000000000,\"RetryMultiplier\":2,\"LocalFileCache\":false,\"TempDir\":\"\",\"ClientProtocol\":\"http1\",\"MaxConnsPerHost\":100,\"MaxIdleConnsPerHost\":100,\"EnableNonexistentTypeCache\":false,\"StackdriverExportInterval\":0,\"OtelCollectorAddress\":\"\",\"LogFile\":\"\",\"LogFormat\":\"json\",\"ExperimentalEnableJsonRead\":false,\"DebugFuseErrors\":true,\"DebugFuse\":false,\"DebugFS\":false,\"DebugGCS\":false,\"DebugHTTP\":false,\"DebugInvariants\":false,\"DebugMutex\":false}"} {"time":{"timestampSeconds":1703683455,"timestampNanos":1703683455611975904},"severity":"INFO","msg":"Loading config from config-file {\"CreateEmptyFile\":false,\"Severity\":\"INFO\",\"Format\":\"json\",\"FilePath\":\"\",\"LogRotateConfig\":{\"MaxFileSizeMB\":512,\"BackupFileCount\":10,\"Compress\":true}}"}

@ankitaluthra1
Copy link
Collaborator Author

ankitaluthra1 commented Dec 27, 2023

  1. In this PR, we are only logging passed flags, right? We also need to print the config flags.
  2. Could you please update the PR description with the newly added logs?
  3. Lint is failing.

Added config file flags as well
Added sample logs in comment
Lint is fixed

main.go Outdated Show resolved Hide resolved
@ankitaluthra1 ankitaluthra1 added the execute-integration-tests Run only integration tests label Dec 28, 2023
main_test.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main_test.go Outdated Show resolved Hide resolved
main_test.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@raj-prince raj-prince left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few minor comments.

Copy link
Collaborator

@raj-prince raj-prince left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Added few nits.

internal/util/util.go Outdated Show resolved Hide resolved
raj-prince
raj-prince previously approved these changes Dec 29, 2023
Copy link
Collaborator

@raj-prince raj-prince left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor doc change.

@ankitaluthra1 ankitaluthra1 merged commit 5c54cfd into master Dec 29, 2023
8 checks passed
@ankitaluthra1 ankitaluthra1 deleted the log-mount-flags branch January 3, 2024 09:37
gargnitingoogle pushed a commit that referenced this pull request Jan 4, 2024
#1565)

* logs flags while mounting gcsfuse

* updates log message for mount flag

* fixes import lint issue

* refactors and renames toString method to support marshalling of nested struct

* refactor stringify to use json marshal

* adds method for error handling in stringify

* updates logger message for flags | remove unnecessary trim space from test

* changes stringify error log to warn log

* makes customType private

* removes extra line from TestStringifyShouldReturnEmptyStringWhenMarshalErrorsOut

* moves Stringify to util package

* adds doc for Stringify

* removes unnecessary TrimSpace

* updates Stringify docs to Go format
ashmeenkaur pushed a commit that referenced this pull request Jan 9, 2024
#1565)

* logs flags while mounting gcsfuse

* updates log message for mount flag

* fixes import lint issue

* refactors and renames toString method to support marshalling of nested struct

* refactor stringify to use json marshal

* adds method for error handling in stringify

* updates logger message for flags | remove unnecessary trim space from test

* changes stringify error log to warn log

* makes customType private

* removes extra line from TestStringifyShouldReturnEmptyStringWhenMarshalErrorsOut

* moves Stringify to util package

* adds doc for Stringify

* removes unnecessary TrimSpace

* updates Stringify docs to Go format
ashmeenkaur pushed a commit that referenced this pull request Jan 10, 2024
#1565)

* logs flags while mounting gcsfuse

* updates log message for mount flag

* fixes import lint issue

* refactors and renames toString method to support marshalling of nested struct

* refactor stringify to use json marshal

* adds method for error handling in stringify

* updates logger message for flags | remove unnecessary trim space from test

* changes stringify error log to warn log

* makes customType private

* removes extra line from TestStringifyShouldReturnEmptyStringWhenMarshalErrorsOut

* moves Stringify to util package

* adds doc for Stringify

* removes unnecessary TrimSpace

* updates Stringify docs to Go format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execute-integration-tests Run only integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants